package health.lm.com.shop.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import health.lm.com.component_base.helper.ImageLoaderHelper;
import health.lm.com.shop.R;
import health.lm.com.shop.entity.HLMyCompanyEntity;

/**
 * Created by Android Studio .
 * Project：hlian health.lm.com.shop.adapter
 * Date：2019/8/13 10:18
 * Introduce：我的商会--商会领导
 */
public class HLMyCompanyLeaderAdapter extends BaseQuickAdapter<HLMyCompanyEntity.LeaderEntity, BaseViewHolder> {
    public HLMyCompanyLeaderAdapter(@Nullable List<HLMyCompanyEntity.LeaderEntity> data) {
        super(R.layout.hl_fragment_my_company_item, data);
    }

    /**
     * Implement this method and use the helper to adapt the view to the given item.
     *
     * @param helper A fully initialized helper.
     * @param item   The item that needs to be displayed.
     */
    @Override
    protected void convert(BaseViewHolder helper, HLMyCompanyEntity.LeaderEntity item) {
        ImageLoaderHelper.getInstance().load(mContext, item.getAvatar(), helper.getView(R.id.imageView11));
        helper.setText(R.id.textView44, item.getTag())
                .setGone(R.id.textView44, !TextUtils.isEmpty(item.getTag()))
                .setText(R.id.textView43, item.getName())
                .setText(R.id.textView45, item.getPosition())
        ;
    }
}
